package cn.pengpeng.day05.mywc;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class WcGcp extends WritableComparator{
	
	public WcGcp() {
		super(Bean.class,true);
		System.out.println("WcGroupingComparator类被实例化了................");
	}
	
	@Override
	public int compare(WritableComparable a, WritableComparable b) {
		System.out.println("WcGroupingComparator类的compare()方法执行了................");
		Bean b1 = (Bean) a;
		Bean b2 = (Bean) b;
		return b1.getWord().compareTo(b2.getWord());
	}

}
